package main

import "fmt"

func dump(label string, slice []string) {
	fmt.Printf("%v:length %v,capacity %v %v\n", label, len(slice), cap(slice), slice)
}
func main() {
	//go1.2引入了能够限制新建切片容量的三索引切分操作
	planets := []string{"Ceres", "Pluto", "Haumea", "Makemake", "Eris"}
	terrestrial := planets[0:4:4]
	worlds := append(terrestrial, "Ceres")
	dump("planets", planets)
	dump("terrestrial", terrestrial)
	dump("worlds", worlds)
}
